  let container = document.querySelector('.container')
   function render(data, el) {
       console.log(data, el)
       data.forEach(item => {
           let li = document.createElement('li');
           let domStr = `
           
               <div productid="${item.productId}" class="img">${item.productImg}</div>
               <div productid="${item.productId}" class="title">${item.productName}</div>
               <p productid="${item.productId}" class="price">${item.productPrice}</p>
               <p productid="${item.productId}" class="from">${item.productFrom}丨${item.productTime}</p>
           `
           li.innerHTML = domStr;
           el.appendChild(li)
        
       })
   }
   function getData() {
       fetch(`http://chst.vip:1234/api/getinlanddiscount`)
           .then(body => body.json())
           .then(res => {
               console.log(res)
               render(res.result, container)
           })
   }
   getData()
  //let ll=$('.container li').get(0)
   /* ll.onclick = function (e) {
    if (e.target) {
        let _this = e.target;
        let id = _this.getAttribute('productid')
        console.log(id)
        location.href = "./gnzklist.html"
    }
} */
   
   container.onclick = function (e) {
    if (e.target) {
        let _this = e.target;
       
        let id = _this.getAttribute('productid')
        console.log(id)
        location.href = "./gnzklist.html?productid="  + id
    }
}
